80127: Function test xfi:period-end

Documentation

Tests of function xfi:period-end($period as element(xbrli:period)) as xs:dateTime

Owners

Name Affiliation Email Start End
Herm Fischer UBMatrix / Mark V Systems fischer@markv.com 19-02-2008 at 00:00:00

References

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670682

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm

Test Case Variations


V-01 xfi:period-end returns correct dateTime for an instant context with date only

Documentation

Tests that either a the instant dateTime element is provided, or an equivalent atomic value of expected dateTime (note that date-only is incremented by one day to represent last instant in date, but date-time does not have its day incremented, per v-04 test below).

Inputs

Outputs

  • Result test: ($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-01-01T00:00:00")

V-02 Returns correct dateTime for concept whose context is instant date (only)

Documentation

Tests that either a the instant dateTime element is provided, or an equivalent atomic value of expected dateTime.

Inputs

Outputs

  • Result test: ($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-01-01T00:00:00")

V-03 End instant for start-end duration context with date only

Documentation

Tests that end instant is properly returned for leap year.

Inputs

Outputs

  • Result test: ($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-29T00:00:00")

V-04 End instant for start-end duration context with time not midnight

Documentation

Tests that end instant is properly returned for date with time, and not advanced to next day.

Inputs

Outputs

  • Result test: ($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-28T23:59:59")

V-04a End instant for start-end duration context with time at preceeding midnight

Documentation

Tests that end instant is properly returned for date with time, and not advanced to next day.

Inputs

Outputs

  • Result test: ($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-28T00:00:00")

V-04b End instant for start-end duration context with time at following midnight

Documentation

Tests that end instant is properly returned for date with time.

Inputs

Outputs

  • Result test: ($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-28T24:00:00") (: note this dateTime may be parsed same as 2008-02-29T00:00:00 and both instants are eq xs:dateTime's anyway :)

V-05 Error for forever context

Documentation

Tests that indicated error is raised for inapplicable context.

Inputs

Outputs

  • Error code: xfie:PeriodIsForever

V-06 Wrong node to function

Documentation

XPath-defined error for node type incorrect.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

V-07 A sequence of periods as argument

Documentation

XPath-defined error for node type incorrect arity of argument.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

Revisions

Name On Details
Herm Fischer 19-02-2008 at 00:00:00 Created the test case.
Herm Fischer 14-04-2008 at 00:00:00 Added more date-with-time variations.